#ifndef PLAYER_H
#define PLAYER_H
/***************************************************
 ** Player Class:
 ** Description: Provides the information regarding
 ** player capabilities, capacities, equipment,
 ** and mechanics.
 ***************************************************/
#include "Vector3D.h"
#include "cAABB.h"
#include "cInventorySystem.h"
#include "cProjectile.h"

#define TURN_UP				0.0F
#define TURN_LEFT			90.0F
#define	TURN_DOWN			180.0F
#define TURN_RIGHT			270.0F


struct PlayerStats
{
	//Controls the amount of health the player has
	unsigned int health;

	//Controls the amount of mana the player has
	unsigned int mana;

	//Controls the amount of power the player has
	unsigned int strength;

	//Controls the amount of resilence the player has
	unsigned int defense;

	//Controls the different resistances the player has
	float resistance;
	float fire_resistance;
	float ice_resistance;
	float dark_resistance;
	float holy_resistance;
};

class cPlayer
{
	public:
		//Constructor : Initialize the components of the class
		cPlayer(Vector3D position = NULL, bool bIsOnScreen = false);

		//Destructor : Deallocate memory from the player class
		~cPlayer();

		//Provide updates the player movement and actions
		void			updatePlayer();

		//Fire Projectiles
		cProjectile*	fireProjectile();

		Vector3D		getPosition()	{ return m_position; }
		Vector3D		getCenter()		{ return m_center; }
		AABB			getBound()		{ return m_bound; }
		bool			isOnScreen()	{ return m_bIsOnScreen; }
		bool			isCollidable()	{ return m_bIsCollidable; }
		bool			canMove()		{ return m_bCanMove; }

		void			changeIsOnScreen(bool bIsOnScreen) { m_bIsOnScreen = bIsOnScreen; }
		void			changeIsCollidable(bool bIsCollidable) { m_bIsCollidable = bIsCollidable; }
		void			changeCanMove(bool bCanMove) { m_bCanMove = bCanMove; }

		float			getOrientation() { return m_orientation; }
		float			getCenterX() { return m_center.getX(); }
		float			getCenterY() { return m_center.getY(); }
		float			getPosX() { return m_position.getX(); }
		float			getPosY() { return m_position.getY(); }
		float			getPosZ() { return m_position.getZ(); }

		void			setPosition(Vector3D position) { m_position = position; }
		void			setStats(PlayerStats stats) { m_stats = stats; }

		void			setOrientation(float angle) { m_orientation = angle; }
		void			setPosX(float x) { m_position.setX(x); }
		void			setPosY(float y) { m_position.setY(y); }
		void			setPosZ(float z) { m_position.setZ(z); }

		//Flags for setting and removing properties
		bool m_bMoveLeft;
		bool m_bMoveRight;
		bool m_bMoveUp;
		bool m_bMoveDown;

	private:
		//Holds the player position
		Vector3D			m_position;
		Vector3D			m_center;

		//Controls the speed in which the player moves
		Vector3D			m_velocity;

		//Controls the player orientation
		float				m_orientation;

		//Holds the AABB collision detecton
		AABB				m_bound;

		//Checks to see if the player can move
		bool				m_bCanMove;

		//Checks to see if the Player is alive
		bool				m_bIsAlive;

		//Checks to see if the player can fire
		bool				m_bCanShoot;

		//Checks to see if the player is collidable
		bool				m_bIsCollidable;

		//Checks to see if the player is on screen
		bool				m_bIsOnScreen;

		//Inventory System for holding the items of the player
		cInventorySystem*	m_inventory;

		//PlayerStats for collision calculation
		PlayerStats			m_stats;
};

#endif